package com.hs.netty.chapter03;

import java.util.Date;

/**
 * @Author: songhao
 * @Date: 2021/8/24
 * @Description: TODO
 */
public class UnixTime {

    private final long value;

    public UnixTime(){
        this(System.currentTimeMillis()/1000L + 2208988800L);
    }

    public UnixTime(long value){
        this.value = value;
    }

    public long getValue(){
        return this.value;
    }

    @Override
    public String toString() {
        return new Date((getValue() - 2208988800L) * 1000L).toString();
    }
}
